package com.zhidisoft.crm.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zhidisoft.crm.dao.ISysRoleFuncMapper;
import com.zhidisoft.crm.entity.SysRoleFunc;
import com.zhidisoft.crm.service.ISysRoleFuncService;
import com.zhidisoft.crm.util.UUidUtil;
@Service
@Transactional
public class SysRoleFuncImpl implements ISysRoleFuncService {
	@Autowired
	ISysRoleFuncMapper roleFuncMapper;
	
	@Override
	public void save(String roleId, String[] funcIds) {
		roleFuncMapper.deleteById(roleId);
		SysRoleFunc roleFunc;
		for (String funcId : funcIds) {
			roleFunc=new SysRoleFunc();
			roleFunc.setId(UUidUtil.uuid());
			roleFunc.setRole_id(roleId);
			roleFunc.setFunc_id(funcId);
			roleFuncMapper.save(roleFunc);
		}
	}

	

}
